#include "zevent/event.hpp"
#include <cstdio>

ZEVT_TYPE(e1);
ZEVT_TYPE(e2, int);
ZEVT_TYPE(e3, int, const char *);
int main() {
  zevent::Queue<5, e1, e2, e3> q;
  e1::Connect([] { printf("e1\n"); });
  e2::Connect([](int i) { printf("e2 %d\n", i); });
  e3::Connect([](int i, const char *str) { printf("e3 %d %s\n", i, str); });

  e1::Publish();
  e2::Publish(1);
  e3::Publish(1, "hello world!");

  puts("after processing the queue");
  q.Connect<e1>([] { puts("e1 in the queue"); });
  q.Connect<e2>([](int a) { printf("e2 in the queue %d\n", a); });
  q.Connect<e3>(
      [](int a, const char *s) { printf("e3 in the queue %d---%s\n", a, s); });
  q.ProcessEvents();
  return 0;
}